package com.cj.st.util;

/**
 * common return
 *
 * @param <T>
 * @author xuxueli 2015-12-4 16:32:31
 */
public class ReturnT<T> {
    public static final ReturnT<String> SUCCESS = new ReturnT<String>(200,null);
    public static final ReturnT<String> FAIL = new ReturnT<String>(500, null);

    private int code;
    private String msg;
    private T content;

    public ReturnT(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public ReturnT(T content) {
        this.code = 200;
        this.content = content;
    }

    public int getCode() {
        return code;
    }

    public ReturnT setCode(int code) {
        this.code = code;
        return this;
    }

    public String getMsg() {
        return msg;
    }

    public ReturnT setMsg(String msg) {
        this.msg = msg;
        return this;
    }

    public T getContent() {
        return content;
    }

    public ReturnT setContent(T content) {
        this.content = content;
        return this;
    }

}
